﻿using BootyBay.Models;
using BootyBay.Repository;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;

namespace BootyBay.ServerWebApp.WCFSvcs
{
	// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "AppMgmtServices" in code, svc and config file together.
	// NOTE: In order to launch WCF Test Client for testing this service, please select AppMgmtServices.svc or AppMgmtServices.svc.cs at the Solution Explorer and start debugging.
	public class AppMgmtServices : IAppMgmtServices
	{
        public View_AppOptRecord4User InsertOptRecord(string userName, AppOperationType optType, int appInfoId)
        {
            var record = AppOperationRecordRepository.Instance().InsertOptRecord(userName, optType, appInfoId);
            return record;
        }

        public List<View_AppOptRecord4User> GetLastOptRecordListForAllApps(string userName)
        {
            var records = AppOperationRecordRepository.Instance().GetAppOptRecord4User(userName);
            return records;
        }

        public View_AppOptRecord4User GetLastOptRecord(string userName, int appInfoId)
        {
            var record = AppOperationRecordRepository.Instance().GetLastOptRecord(userName, appInfoId);
            return record;
        }
 
    }
}
